package com.hmy.finance.service.receipt.dto.recharge;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hmy.finance.dal.po.RechargeTransactionBillPo;
import lombok.Data;

import java.util.List;

/**
 * 已冲抵合同费用回充DTO
 *
 * @athor songkf
 */
@Data
public class RechargeContractFeeBillDto implements java.io.Serializable {
    private static final long serialVersionUID = -2106789956223655942L;

    //=============== Request Parameters ===============
    /**
     * 合同ID
     */
    private Long contractId;

    //=============== Logic Process Parameters ==============
    /**
     * 余额回充业务单据集合
     */
    private List<RechargeTransactionBillPo> rechargeTransactionBillList;

    /**
     * 获取合同待冲抵费用回充业务单据查询Wrapper
     *
     * @return 合同待冲抵费用回充业务单据查询Wrapper
     * @author songkf
     */
    public Wrapper<RechargeTransactionBillPo> getContractWaitRechargeBillListQueryWrapper() {
        return Wrappers.lambdaQuery(RechargeTransactionBillPo.class)
                .eq(RechargeTransactionBillPo::getContractId, contractId)
                .eq(RechargeTransactionBillPo::getRechargeStatus, 1);
    }

    public static RechargeContractFeeBillDto getInstance(Long contractId) {
        RechargeContractFeeBillDto rechargeContractFeeBillDto = new RechargeContractFeeBillDto();
        rechargeContractFeeBillDto.setContractId(contractId);
        return rechargeContractFeeBillDto;
    }

}
